<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">

	<html>
		<head>
			<title>register</title>
			<p:resources/>
		</head>
		
		<body>
			<h:form>
				<p:messages />
				<p:panel>
				<h:panelGrid columns="3">
					
					<h:outputLabel value="User name" />
					<h:inputText id="userNameId" value="#{userName}" required="true" validatorMessage="User name must be at least 7 letters" requiredMessage="Please enter a user name">
						<f:validateLength minimum="7"></f:validateLength>
					</h:inputText>
<!-- 					<p:message for="userNameId"/> -->
					
					<h:outputLabel value="First name" />
					<h:inputText id="firstNameId" value="#{firstName}" required="true" validatorMessage="First name must be at least 3 letters"  requiredMessage="Please enter a first name">
						<f:validateLength minimum="3"></f:validateLength>
					</h:inputText>
<!-- 					<p:message for="firstNameId"/> -->
					
					<h:outputLabel value="Last name" />
					<h:inputText id="lastNameId" value="#{lastName}" required="true" validatorMessage="Last name must be at least 3 letters" requiredMessage="Please enter a last name">
						<f:validateLength minimum="3"></f:validateLength>	
					</h:inputText>
<!-- 					<p:message for="lastNameId"/> -->
					
					<h:outputLabel value="Shhhh, password" />
					<h:inputSecret id="passwordId" value="#{password}" required="true" validatorMessage="Password must be at least 8 letters" requiredMessage="Please enter a password">
						<f:validateLength minimum="8"></f:validateLength>
					</h:inputSecret>
<!-- 					<p:message for="passwordId"/> -->
					
					<h:outputLabel value="Confirm password" />
					<h:inputSecret id="password2Id" value="#{confirmPassword}" required="true" validatorMessage="Please confirm password"/>
<!-- 					<p:message for="password2Id"/> -->
					
					<h:commandButton action="#{registerControllerBean.register()}" value="Register" />
				</h:panelGrid>
				</p:panel>
			</h:form>
		</body>
	</html>

</f:view>